//
// Created by lucy on 1/18/2024.
//

#ifndef OOP_MUTABLE_CONTAINER_MUTABLEARRAYCONTAINER_H
#define OOP_MUTABLE_CONTAINER_MUTABLEARRAYCONTAINER_H

#include "MutableContainer.h"
template <typename E>
class MutableArrayContainer : public MutableContainer<E>
{
private:
    int len;
    E *array;

public:
    int length() override;

    bool validIndex(int index) override;

    void printError();

    MutableArrayContainer();

    void add(E ele) override;

    void add(int index, E ele) override;

    E remove(int index) override;

    bool removeElement(E ele) override;

    void clear() override;

    E set(int index, E ele) override;

    E get(int index) override;

    void sort() override;

    int index(E ele) override;

    std::string str() override;

    ~MutableArrayContainer();
};

#endif // OOP_MUTABLE_CONTAINER_MUTABLEARRAYCONTAINER_H
